<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="typefo">
    <link rel="icon" href="favicon.ico">
    <title>pbxMon System</title>
    <link type="text/css" rel="stylesheet" href="/css/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="/css/bootstrap-theme.min.css">
    <link type="text/css" rel="stylesheet" href="/css/interface.css">
  </head>
  <body>
    <nav class="navbar navbar-default navbar-static-top">
      <div class="container">
        <div class="navbar-header">
          <a class="navbar-brand">
            <img alt="Brand" src="/img/logo.png" width="34" style="margin-top:-8px" />
          </a>
          <a class="navbar-brand">pbxMon</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li><a href="/cdr">通话记录</a></li>
            <li><a href="/server">网关管理</a></li>
            <li><a href="/route">路由管理</a></li>
            <li><a href="/interface">接口管理</a></li>
            <li><a href="/report">数据报表</a></li>
            <li><a href="/system/status">服务器状态</a></li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li><a href="/system/option"><span class="glyphicon glyphicon-cog"></span> 系统设置</a></li>
            <li><a href="/logout"><span class="glyphicon glyphicon-log-out"></span> 退 出</a></li>
          </ul>
        </div>
      </div>
    </nav>
    <div class="container">
      <div class="row">
        <ol class="breadcrumb">
          <li><a href="/cdr">Home</a></li>
          <li><a href="/interface">Interface</a></li>
          <li class="active">Edit</li>
          <li class="pull-right help"><span class="glyphicon glyphicon-question-sign"></span> <a href="#">帮助信息</a></li>
        </ol>
      </div>
      <div class="row">
        <div class="container main">
          <form class="form-horizontal" action="/interface/edit?id=<?php echo isset($data['id']) ? $data['id'] : '';?>" method="post">
            <div class="form-group">
              <label class="col-sm-offset-2 col-xs-2 col-sm-2 control-label">接口名称:</label>
              <div class="col-xs-3 col-sm-3">
                <input type="text" class="form-control" value="<?php echo isset($data['name']) ? $data['name'] : '';?>" disabled="disabled">
              </div>
              <div class="col-xs-2 col-sm-2">
                <span class="help-block">接口名称</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-offset-2 col-xs-2 col-sm-2 control-label">绑定 IP:</label>
              <div class="col-xs-3 col-sm-3">
                <input type="text" class="form-control" name="ip" value="<?php echo isset($data['ip']) ? $data['ip'] : '';?>" placeholder="Enter ip address" required="required">
              </div>
              <div class="col-xs-3 col-sm-3">
                <span class="help-block">绑定接口 IP 地址</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-offset-2 col-xs-2 col-sm-2 control-label">绑定端口:</label>
              <div class="col-xs-3 col-sm-3">
                <input type="number" class="form-control" name="port" value="<?php echo isset($data['port']) ? $data['port'] : '';?>" placeholder="Enter port" min="1" max="65535" required="required">
              </div>
              <div class="col-xs-3 col-sm-3">
                <span class="help-block">绑定端口</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-offset-2 col-xs-2 col-sm-2 control-label">呼入编码:</label>
              <div class="col-xs-3 col-sm-3">
                <input type="text" class="form-control" name="in_code" value="<?php echo isset($data['in_code']) ? $data['in_code'] : '';?>" placeholder="Enter in code" required="required">
              </div>
              <div class="col-xs-3 col-sm-3">
                <span class="help-block">用于呼入编码协商</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-offset-2 col-xs-2 col-sm-2 control-label">呼出编码:</label>
              <div class="col-xs-3 col-sm-3">
                <input type="text" class="form-control" name="out_code" value="<?php echo isset($data['out_code']) ? $data['out_code'] : '';?>" placeholder="Enter out code" required="required">
              </div>
              <div class="col-xs-3 col-sm-3">
                <span class="help-block">用于呼出编码协商</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-offset-2 col-xs-2 col-sm-2 control-label">备注信息:</label>
              <div class="col-xs-3 col-sm-3">
                <input type="text" class="form-control" name="description" value="<?php echo isset($data['description']) ? htmlspecialchars($data['description'], ENT_QUOTES) : '';?>" placeholder="Enter description" />
              </div>
              <div class="col-xs-3 col-sm-3">
                <span class="help-block">网关相关备注说明</span>
              </div>
            </div>
            <div class="form-group">
              <div class="col-sm-offset-4 col-xs-3 col-sm-3">
                <button type="submit" id="submit" class="btn btn-success">保 存</button>
                <a class="btn btn-default" href="/interface">取 消</a>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </body>
  <script type="text/javascript" src="/js/jquery.min.js"></script>
  <script type="text/javascript" src="/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="/js/layer.js"></script>
  <script type="text/javascript">
    $("#submit").click(function(){
      var index = layer.load(2, {shade: [0.7,'#fff'], time: 3000});
    });
  </script>
</html>
